home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / web / fweb / fweb-1.40 / boot / misc / custom.h < prev    next >
C/C++ Source or Header  |  1993-10-29  |  14KB  |  411 lines

  1.  
  2. /* --- BOOTSTRAPPING --- */
  3.  
  4. /* To bootstrap yourself onto a new system, you should modify this file \
  5. appropriately.  In most cases, you set a flag by saying ``\.{\#define \
  6. FLAG}''---i.e., you make a null definition.  Don't set these flags to~0 \
  7. or~1.  However, in a few cases the macros are not flags and must be given \
  8. the appropriate definition. */
  9.  
  10. /* --- MACHINE COMPILER FLAG --- */
  11.  
  12. /*  This must be in lower case.   Presently these are drawn \
  13. from the list \.{ansi}, \.{apollo}, \.{bsd}, \.{dsu}, \.{ibmpc}, \.{mac}, \
  14. \.{misc}, \.{mvs}, \.{sgi}, \.{sun}, \.{vax}.  These flags may be used in \
  15. \.{\#define} statements within the source code to tailor things to a \
  16. particular compiler or operating system. */
  17. #ifndef misc
  18. #define misc
  19. #endif /* |misc| */
  20.  
  21.  
  22. /* --- FWEB SYSTEM NAME --- */
  23.  
  24. /* This is a string such  as ``\.{IBM-PC/DOS}'' or ``\.{VAX/VMS}''. It is \
  25. printed when FWEB starts up.--- */
  26. #define THE_SYSTEM  "Vanilla"
  27.  
  28. /* --- An optional local banner, printed after the system name above. --- */
  29.  
  30. #define LOCAL_BANNER ""
  31.  
  32.  
  33. /* Does your compiler understand the ANSI preprocessor command \.{\#error}? \
  34. If it does, define |HAVE_ERROR|.  (I haven't figured out a general \
  35. \.{autoconf} test yet; it seems to be impossible in principle.) */
  36.  
  37. #define HAVE_ERROR 0
  38.  
  39.  
  40. /* Do we bother with translations to the internal |ASCII| representation? \
  41. If so, define |TRANSLATE_ASCII|.  Don't bother on |ASCII| machines. */
  42.  
  43. #define TRANSLATE_ASCII 0
  44.  
  45. /* For \It{debugging} of target machines whose character set differs from the \
  46. one on which you're working, define |DEBUG_XCHR|.  \It{Usually, this flag \
  47. should not be defined.}  When it is defined, the |TRANSLATE_ASCII| flag is \
  48. automatically turned on, and the value of the style-file field \
  49. \.{xchr} is relevant. \It{Don't use this flag unless you're a system \
  50. developer!!!} */
  51.  
  52. #define DEBUG_XCHR 0
  53.  
  54.  
  55. /* Does the operating system have a Unix-like path?  That is, does it have \
  56. the form \.{/u/krommes} rather than the VMS form \.{ux3:[krommes]}? \
  57. If so, define |UNIX_PATH|. */
  58.  
  59. #define UNIX_PATH 1
  60.  
  61.  
  62. /* If the |getenv| call to obtain an environment variable is supported \
  63. (it usually is) define |HAVE_GETENV|. */
  64. #define HAVE_GETENV 1
  65.  
  66.  
  67. /* --- FILE NAMES and EXTENSIONS --- */
  68.  
  69. /* Name of the null file.  IBMPC:  \.{"nul"}; Unix: \.{"/dev/null"}; VAX: \
  70. \.{"nl:"}. */
  71. #define NULL_FILE_NAME "/dev/null" /* For Unix systems. */
  72.  
  73. /* Name of \FWEB's initialization file.  Please see below, after the \
  74. definition of |SMALL_MEMORY|. */
  75.  
  76. /* Name of \FWEB's default style file. \
  77. \It{Please don't change this unless you absolutely have to! \
  78. Use the \.{-z} option instead.} */
  79.  
  80. #define STYLE_FILE_NAME "fweb.sty"
  81.  
  82. /* Here are the default file extensions for each language. */
  83.  
  84. #define C_EXT "c"
  85. #define V_EXT "mk"
  86. #define X_EXT "sty"
  87.  
  88. /* Unix. */
  89. #define Cpp_EXT "c++"
  90. #define R_EXT "r"
  91. #define R90_EXT "r90"
  92. #define N_EXT "f"
  93. #define N90_EXT "f90"
  94.  
  95. #define HAVE_TMPNAM 1
  96. #define HAVE_TEMPNAM 0
  97.  
  98.  
  99. /* The |FANCY_SPLIT| flag is used for buffering the output lines of C~code. \
  100. Define this if the C~compiler CAN'T continue an incomplete line with a \
  101. backslash.  (ANSI compilers should be able to.) \
  102. {\bf (This code may not be fully debugged yet!)} */
  103.  
  104. #define FANCY_SPLIT 0
  105.  
  106.  
  107. /* --- INCLUDING FILES --- */
  108.  
  109. /* The code is written in C, and various header files of the form \
  110. ``\.{<*.h>}'' are included near the beginning of each source file.  The \
  111. names of these files are standardized by ANSI.  Unfortunately, not everyone \
  112. has gotten around to ANSI yet.  Therefore, here we include important files \
  113. whose names may be nonstandard or whose functions may fluctuate. */
  114.  
  115. /* Does the ANSI \.{stdlib.h} exist?  If so, say so here.  This is \
  116. supposed to contain prototypes for the following functions used by \FWEB: \
  117. |abort|, |abs|, |atof|, |atoi|, |atol|, |calloc|, |exit|, |free|, |getenv|, \
  118. |realloc|, |strtod|, |strtol|.  If it doesn't, either find the prototypes \
  119. in another file and include it here, or actually give the prototypes here. \
  120. */
  121.  
  122. #define HAVE_STDLIB_H 1
  123.  
  124. #define HAVE_STDARG_H 1
  125.  
  126.  
  127. /* Does the ANSI \.{stddef.h} exist?  If so, include it here.  This is \
  128. supposed to define the |NULL| pointer, and the type |size_t|.  Sometimes \
  129. these are defined in other places as well. */
  130.  
  131. #define HAVE_STDDEF_H 1
  132.  
  133. /* Other stuff handled by auto-config. */
  134. #define HAVE_STRING_H 1
  135.  
  136. #define HAVE_MEMORY_H 0
  137.  
  138. #define HAVE_FLOAT_H 1
  139.  
  140. /* Does  (non-ANSI) \.{sys/types.h} exist?  You may find some useful stuff \
  141. in here. But don't use it unless you have to. */
  142.  
  143. /*  #include<sys/types.h> */
  144.  
  145. /* Must we include an extra file for memory management?  E.g., for \
  146. Microsoft, \.{malloc.h}; for Borland; \.{alloc.h}.  Not necessary for ANSI; \
  147. it's in \.{stdlib.h}. */
  148.  
  149. /*  #include<malloc.h> */
  150.  
  151. /* Numerical limits.  We use the following ANSI macros: |INT_MAX|, \
  152. |INT_MIN|, |LONG_MAX|, |LONG_MIN|, and |ULONG_MAX| which are found in \
  153. \.{limits.h}. If you can't find those macros, define the flag \
  154. |NON_ANSI_LIMITS|, and possibly include another file with different names \
  155. for the limits, such as \.{values.h} on the Sun.  The flag \
  156. |NON_ANSI_LIMITS| assumes that the macros |MAXINT| and |MAXLONG| are \
  157. defined.  If they are not, you must define them here. */
  158.  
  159. #define HAVE_LIMITS_H 1
  160. #define HAVE_VALUES_H 0
  161.  
  162. /* Please note that additional files are included automatically \
  163. (essentially immediately after this file is read; see \.{includes.hweb}). \
  164. These were considered to be standard, but that might be a mistake.  Those \
  165. files are: \
  166. \.{string.h}, \.{stdio.h}, \.{ctype.h}, \.{setjmp.h}, \.{time.h}.  Remember \
  167. that by convention these files should limit themselves to being included \
  168. only once.  Therefore, if for some reason you need to include one of these \
  169. somewhere in this file, you should be able to do it without difficulty; the \
  170. later automatic include just won't be done if those files are following \
  171. standard protocol. */
  172.  
  173. #define ANSI_CTYPE_H 0
  174.  
  175.  
  176. /* --- VARIABLE-LENGTH ARGUMENT LISTS --- */
  177.  
  178. /* For convenience, FWEB attempts to use functions with variable numbers of \
  179. arguments.  We attempt to support two conventions: ANSI, and Sun's.  If \
  180. this feature is supported, define the flag |VARIABLE_ARGUMENTS|, say \
  181. whether |va_start| has one or two arguments, and include \
  182. the associated header file (\.{stdarg.h} for ANSI). */
  183.  
  184. /* Does the compiler allow ANSI-style variable arguments? */
  185.  
  186. #define VARIABLE_ARGUMENTS 1
  187.  
  188. /* Is |va_start| defined with one argument (Sun's convention) or two \
  189. (ANSI)? */
  190. #define NUM_VA_ARGS 2
  191. #define HAVE_STDARG_H 1
  192.  
  193.  
  194. /* --- ADDITIONAL PROTOTYPES --- */
  195.  
  196. /* You may wish to collect any additional prototypes that are required and \
  197. put them into your own header file that you include here. */
  198.  
  199. /* If the flag |HAVE_STD_PROTOTYPES| is false, it causes the file \
  200. \.{stdlib0.h} to be loaded.  This contains ANSI prototypes that for some \
  201. reason aren't provided with the \.{gcc}~environment on the Sun. */
  202. #define HAVE_STD_PROTOTYPES 1
  203.  
  204. /* Define the flag |OLD_PROTOTYPES| for \
  205. compilers that don't support the new (ANSI) style of function declaration \
  206. and prototyping.  The new style is |fcn(int i,char *s){}|; the old style is \
  207. |fcn(i,s) int i; char *s; {}|. */
  208.  
  209. #define OLD_PROTOTYPES 1
  210.  
  211. /* ANSI also introduces the type |void|.  If your compiler doesn't \
  212. understand the constructions |void *| and |void fcn()|, define |NO_VOID|. */
  213.  
  214. #define NO_VOID 0
  215.  
  216.  
  217. /* --- SPECIAL TYPES --- */
  218.  
  219. /* ANSI defines the |size_t| type, which is the type of something returned \
  220. from the |sizeof| operator.  If this type is defined, define \
  221. |SIZE_T_DEFINED|. */
  222.  
  223. #define SIZE_T_DEFINED 1
  224.  
  225.  
  226. /* |const| seems to be an annoyance; not all compilers treat it the same \
  227. way.  We really only want it for debugging, anyway, so we mostly just \
  228. remove it.  It's kept when compiling on the Sun with \.{gcc}, because it \
  229. gives the developer more checks on the code.  If you want to keep it, \
  230. define |KEEP_CONST|. */
  231.  
  232. #define KEEP_CONST 0
  233.  
  234. /* For personal computers, the kind of pointer is an issue.  They must be \
  235. |huge|.  If your compiler understands |huge|, define |HUGE_POINTERS|. */
  236.  
  237. #define HUGE_POINTERS 0
  238.  
  239.  
  240. /* --- SPECIAL FUNCTIONS --- */
  241.  
  242. /* The ANSI |sprintf| function returns the number of characters written. \
  243. If this is the case on your system, define |ANSI_SPRINTF|.  (It's always \
  244. safe to not define it. */
  245.  
  246. #define ANSI_SPRINTF 0
  247.  
  248. /* The ANSI |sscanf| does some cute things. */
  249. #define ANSI_SSCANF 0
  250.  
  251. /* The ANSI |system| function is supposed to take |NULL| as an argument, \
  252. which means check if a command processor exists.  If this works properly, \
  253. defined |ANSI_SYSTEM|.  (It doesn't work on the Sun.) */
  254.  
  255. #define ANSI_SYSTEM 0
  256.  
  257.  
  258. /* --- ANNOYING WARNINGS --- */
  259.  
  260. /* Sometimes the compiler can't understand that the \
  261. control flow can never get to the bottom of a function. To avoid warning \
  262. complaints, we have the following: */
  263. #define DUMMY_RETURN(value) return value
  264.  
  265.  
  266. /* --- UNUSUAL NAMES --- */
  267.  
  268. /* Put here any definitions that override standard names.  For example, on \
  269. the MAC one has to say ``\.{\#define getc agetc}''. */
  270. /* Nothing to be done. */
  271.  
  272.  
  273. /* --- DIRECTORY SPECIFICATIONS --- */
  274.  
  275. /* Directory specifications are delimited in different ways under the various \
  276. operating systems. Unix: \.{'/'}; IBM-PC: \.{'\\'}; VAX/VMS: \,{']'}. */
  277. #define PREFIX_END_CHAR '/' /* The Unix convention. */
  278.  
  279.  
  280. /* --- TIMING --- */
  281.  
  282. /* First of all, we have a flag to say whether timing information is \
  283. printed at the end of the run.  (If you can't figure out the timing \
  284. routines for your machine or don't want a timing information line at the \
  285. end of your terminal output, don't define this.) */
  286.  
  287. #define TIMING 1
  288.  
  289. /* --- Number of decimal places  for timing information in seconds.  (Use \
  290. at least 2 for supercomputers.) --- */
  291. #define timing_width 1
  292.  
  293. /* There's supposed to be a function |clock()| that returns the cpu time, \
  294. in units of |CLOCKS_PER_SEC|.  The type of |clock| is |clock_t|.  If that \
  295. is defined, define the flag |CLOCK_T_DEFINED|; otherwise, say |typedef ... \
  296. clock_t| here. */
  297.  
  298. #define CLOCK_T_DEFINED 1
  299.  
  300. /* Some systems don't define |CLOCKS_PER_SEC|.  If not, we try |CLK_TCK|. \
  301. If that's not defined, it defaults to 1000000.  If that's not appropriate, \
  302. define |CLOCKS_PER_SEC| here. */
  303.  
  304. /* \
  305. #define CLOCKS_PER_SEC 1000000 \
  306. */
  307.  
  308. /* Are there system routines that return wall-clock time in sub-second units? \
  309. First, look for |gettimeofday| ($\mu$sec timing). */
  310. #define HAVE_GETTIMEOFDAY 0
  311.  
  312. /* Otherwise, does the file sys/timeb.h exist that along with |ftime| gives \
  313. millisecond timing for wall-clock time?  We check for the header file, not \
  314. |ftime| itself, since |ftime| may be in a Berkeley compatibility library, \
  315. not in \.{libc}. */
  316.  
  317. #define HAVE_SYS_TIMEB_H 0
  318.  
  319. /* Do we use our own version of difftime(), which computes the difference \
  320. of two wall clock times?  If so, define |NEW_DIFFTIME|.  This flag should \
  321. always be defined if |HAVE_SYS_TIMEB_H| is defined above.  */
  322.  
  323. #define NEW_DIFFTIME 1
  324.  
  325.  
  326. /* --- MAKING IT FIT --- */
  327.  
  328. /* Sometimes the compiler can't handle functions or switches that are too \
  329. large.  In that case, define |FCN_CALLS|.  That converts certain in-line \
  330. code (such as in the syntax production analyzer) into function calls (at \
  331. the price of slowing things down a bit). */
  332.  
  333. #define FCN_CALLS 0
  334.  
  335. /* The personal computers are starved for memory.  For those machines, we \
  336. specify smaller default values for the lengths of dynamic arrays; define \
  337. |SMALL_MEMORY|.  (You can always use the \.{-y} option to override these \
  338. defaults.) */
  339.  
  340. #define SMALL_MEMORY 0
  341.  
  342. /* Name of \FWEB's default initialization file.  Please don't change these \
  343. conventions unless you absolutely have to!!!  Also, note that these \
  344. definitions are overridden by the environment variable |FWEB_INI|, if it is \
  345. defined. */
  346.  
  347. #ifndef SMALL_MEMORY
  348. #define SMALL_MEMORY 0
  349. #endif
  350.  
  351. #if SMALL_MEMORY
  352. #define FWEB_INI "fweb.ini"
  353. #else
  354. #define FWEB_INI ".fweb"
  355. #endif
  356.  
  357.  
  358. /* --- MEMORY ALLOCATIONS --- */
  359.  
  360. /* The ANSI |calloc| routine takes two arguments:  |void \
  361. *calloc(size_t,size_t)|. If the system doesn't have a standard |calloc| \
  362. routine, or if the name isn't standard, you must define an UPPERCASE macro \
  363. that does the same thing.  (The name isn't standard on personal computers \
  364. because one is dealing with |huge| allocations.)  If you define \
  365. |NON_ANSI_CALLOC|, you must define |CALLOC|, |REALLOC|, and |FREE|.  E.g., the \
  366. relevant definitions for Borland are \
  367. \begintt \
  368. #define CALLOC farcalloc \
  369. #define REALLOC(oldblock,nbytes) \ \
  370.  farrealloc((void far *)(oldblock),(unsigned long)(nbytes)) \
  371. #define FREE(block) farfree((void far *)(block)) \
  372. \endtt \
  373. */
  374.  
  375. #define NON_ANSI_CALLOC 0
  376.  
  377. /* |IBMPC| */
  378.  
  379. /* Do we supply below a routine that obtains the available memory, such \
  380. as Borland's farcoreleft()? */
  381.  
  382. #define PRINT_AVAILABLE_MEMORY 0
  383.  
  384. /* The function call that obtains the memory is called |CORE_LEFT|.  This \
  385. function is assumed to return an |unsigned long int|.  For Microsoft, we had \
  386. to write our own routine |_hmemavl|; see below.  For Borland, the routine \
  387. should be called |farcoreleft|.  For the other machines, we don't have \
  388. anything as yet. */
  389.  
  390.  
  391.  
  392.  
  393. /* The following flag is defined only by \.{common.web}. */
  394. #ifdef COMMON_FCNS_
  395.  
  396. /* Give here the C code for any additional functions that are \
  397. compiler-specific or missing from your implementation, such as maybe \
  398. |strtod|.  Note that these are bracketed with the flag COMMON_FCNS_ so they \
  399. are compiled into just one module, namely \.{common.c}. You must \
  400. always supply some version of the debugging routine |trap|, which must \
  401. return~0 as a minimum. */
  402.  
  403.  
  404. /* The default |trap| function for debugging. */
  405. int trap()
  406. {return 0;}
  407.  
  408. #endif /* |COMMON_FCNS_| */
  409.  
  410.  
  411.